Prop8 = "Click on ""..."" for the About Box ---->"
Prop9 = "Click on ""..."" for the Message Center --->"
Left = 4620
MsgList = MOUSEPTR.FRX:0604
MsgPassage = MOUSEPTR.FRX:0668
TargetName = "Text1"
Top = 4320
UserMsgs = MOUSEPTR.FRX:069A
Version = "2.0"
End
Begin PictureBox Picture2
DragIcon = MOUSEPTR.FRX:0A37
Height = 432
Left = 3120
Picture = MOUSEPTR.FRX:0D39
ScaleHeight = 408
ScaleWidth = 408
TabIndex = 4
Top = 3840
Visible = 0 'False
Width = 432
End
Begin MsgBlaster Msg2
Prop8 = "Click on ""..."" for the About Box ---->"
Prop9 = "Click on ""..."" for the Message Center --->"
Left = 2760
MsgList = MOUSEPTR.FRX:103B
MsgPassage = MOUSEPTR.FRX:109F
TargetName = "Check1"
Top = 3840
UserMsgs = MOUSEPTR.FRX:10D1
Version = "2.0"
End
Begin CheckBox Check1
BackColor = &H00C0C0C0&
Caption = "Star"
Height = 252
Left = 2700
TabIndex = 3
Top = 3600
Width = 1332
End
Begin TextBox Text1
Height = 732
Left = 4320
TabIndex = 2
Text = "This one will have a face"
Top = 3540
Width = 2172
End
Begin ListBox List1
BackColor = &H00FFFF00&
Height = 1176
Left = 660
TabIndex = 1
Top = 3600
Width = 1872
End
Begin MsgBlaster Msg1
Prop8 = "Click on ""..."" for the About Box ---->"
Prop9 = "Click on ""..."" for the Message Center --->"
Left = 300
MsgList = MOUSEPTR.FRX:146E
MsgPassage = MOUSEPTR.FRX:14D2
TargetName = "List1"
Top = 4440
UserMsgs = MOUSEPTR.FRX:1504
Version = "2.0"
End
Begin PictureBox Picture1
DragIcon = MOUSEPTR.FRX:18A1
Height = 432
Left = 180
Picture = MOUSEPTR.FRX:1BA3
ScaleHeight = 408
ScaleWidth = 408
TabIndex = 0
Top = 3960
Visible = 0 'False
Width = 432
End
Begin Label Label3
Caption = "A couple of other things. Make sure the icons you use are black and white or transparent only. Color will have unpredictable results. Windows doesn't know how to deal with color cursors. Also, don't use .CUR files, they won't work."
Height = 792
Left = 240
TabIndex = 9
Top = 2700
Width = 6192
End
Begin Label Label2
Caption = "This example is copyright 1994 Ed Staffin. See the about box on the Message Blaster for details."
Height = 432
Left = 1380
TabIndex = 7
Top = 60
Width = 4152
End
Begin Label Label1
BackColor = &H00FFFF80&
Caption = "In this example I used 3 Message Blasters, 3 Picture Boxes and 3 different icons. I used the msgcenter property to set the target window to the controls that I want a custom cursor for and trapped the WM_SETCURSOR message. I made sure that the message was eaten as opposed to the default (Post Process). Then I set the DragIcon property of the picture boxes to the icon I wanted to used as a cursor. I then made sure the picture box's visible property was set to false. Next, just to make it easier to tell which is which, I set the picture property of the picture box to my icon. Then is was just a matter of catching the WM_SETCURSOR and doing a SetCursor API call. Check the Message event for details."
Height = 1992
Left = 240
TabIndex = 6
Top = 600
Width = 6192
End
End
Option Explicit
Declare Function SetCursor Lib "User" (ByVal hCursor As Integer) As Integer
Declare Function DefWindowProc Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
Sub cmdQuit_Click ()
End
End Sub
Sub Form_Load ()
Dim i%
For i = 1 To 15
list1.AddItem "Bang " & i
Next i
End Sub
Function HIWORD (l As Long) As Integer
' Change the As Integer to As Long
' if you need unsigned results
HIWORD = CInt((l And &HFFFF0000) \ &H10000)
End Function
Function LOWORD (l As Long) As Integer
' Change the As Integer to As Long
' if you need unsigned results
LOWORD = l And &HFFFF&
End Function
Sub Msg1_Message (MsgVal As Integer, wParam As Integer, lParam As Long, ReturnVal As Long)
' copyright 1994 Ed Staffin
Const HTCLIENT = 1
Dim rc%
' The IF statement checks to see if the DragIcon
' property of your PicturBox was non-NULL, and that
' the cursor is over the client area,
' (low word of lParam == 1 when cursor is there).
' If you leave off the "else" statement then the
' cursor will not be appropriate for the borders or
' caption.
Select Case MsgVal
Case WM_SETCURSOR
If (LOWORD(lParam) = HTCLIENT) And (Picture1.DragIcon) Then